<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增微信小程序配置')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-applet-add">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">小程序/公众号类型：</label>
            <div class="col-sm-3">
                <select name="appletType" class="form-control m-b"
                        th:with="type=${@dict.getType('sys_applet_type')}" required>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                            th:value="${dict.dictValue}"></option>
                </select>
            </div>
            <label class="col-sm-3 control-label is-required">小程序/公众号名称：</label>
            <div class="col-sm-3">
                <input name="appletName" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">小程序/公众号ID：</label>
            <div class="col-sm-9">
                <input name="appid" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">小程序/公众号密钥：</label>
            <div class="col-sm-9">
                <input name="secret" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">获取openid的Url(小程序配置)：</label>
            <div class="col-sm-9">
                <input name="getOpenIdUrl" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">前端重定向地址（公众号配置）：</label>
            <div class="col-sm-9">
                <input name="redirectUri" class="form-control" type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">子系统编号(调用数据平台配置)：</label>
            <div class="col-sm-9">
                <input name="subSysCode" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">子系统密钥(调用数据平台配置)：</label>
            <div class="col-sm-9">
                <input name="subSysToken" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">业务通知模板编号：</label>
            <div class="col-sm-9">
                <input name="templateId" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">业务通知模板：</label>
            <div class="col-sm-9">
                <textarea name="template" class="form-control"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">短信签名：</label>
            <div class="col-sm-9">
                <input name="signature" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">归属法人：</label>
            <div class="col-sm-3">
                <select name="deptId" class="form-control m-b" th:with="type=${@dept.selectDeptListByType('2')}"
                        required>
                    <option value="">请选择</option>
                    <option th:each="dept : ${type}" th:text="${dept.deptName}" th:value="${dept.deptId}"></option>
                </select>
            </div>
            <label class="col-sm-3 control-label">小程序版本：</label>
            <div class="col-sm-3">
                <select name="versionDesc" class="form-control m-b"
                        th:with="type=${@dict.getType('sys_wechat_applet_version')}">
                    <option value="">请选择</option>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                            th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>

    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "system/applet"
    $("#form-applet-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-applet-add').serialize());
        }
    }
</script>
</body>
</html>